package com.JobFind.controller;

import java.io.PrintWriter;

import javax.annotation.Resource;
import com.JobFind.DTO.ResumeDTO;
import com.JobFind.DTO.UserDTO;
import com.JobFind.logic.IResumeLogic;

public class ResumeController extends BaseAction {

	private static final long serialVersionUID = 1L;
	private ResumeDTO resumeDTO;
	private UserDTO userDTO;
	private IResumeLogic resumeLogic;
	
	public IResumeLogic getResumeLogic() {
		return resumeLogic;
	}
	
	@Resource
	public void setResumeLogic(IResumeLogic resumeLogic) {
		this.resumeLogic = resumeLogic;
	}
	public ResumeDTO getResumeDTO() {
		return resumeDTO;
	}
	public void setResumeDTO(ResumeDTO resumeDTO) {
		this.resumeDTO = resumeDTO;
	}
	public UserDTO getUserDTO() {
		return userDTO;
	}
	public void setUserDTO(UserDTO userDTO) {
		this.userDTO = userDTO;
	}
	
	public void updateIntroduce() throws Exception{
		PrintWriter out = getWriter();
		try {
			out.println(this.resumeLogic.updateResume(resumeDTO, userDTO));
		} catch (Exception e) {
			e.printStackTrace();
		} finally{
			out.flush();
			out.close();
		}
	}
	
	public void getResInfoByUserId() throws Exception{
		PrintWriter out = getWriter();
		try {
			out.println(this.resumeLogic.getResInfoByUserId(resumeDTO.getUserDTO().getUserId()));
		} catch (Exception e) {
			e.printStackTrace();
		} finally{
			out.flush();
			out.close();
		}
	}
	
	public void updateResumeInfo() throws Exception{
		PrintWriter out = getWriter();
		try {
			//out.println(this.resumeLogic.updateResumeInfo(resumeDTO.getUserDTO().getUserId(), resumeDTO.getCompanyDTO().getCompanyId(), resumeDTO.getJobPosition()));
		} catch (Exception e) {
			e.printStackTrace();
		} finally{
			out.flush();
			out.close();
		}
	}
}
